<?php


namespace app\common\model;


class Shop extends BaseModel
{
    protected $table = 'fa_shop';

    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';

    public function getCreatetimeTextAttr($value, $data)
    {
        return $data['createtime'] > 0 ? date('Y-m-d H:i:s', $data['createtime']) : '';
    }

    public function getUpdatetimeTextAttr($value, $data)
    {
        return $data['updatetime'] > 0 ? date('Y-m-d H:i:s', $data['updatetime']) : '';
    }
}